﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RoadTeam.Model;
using RoadTeam.Enums;

public partial class 增删改测试_DeleteDemo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Bind();
        }
    }

    private void Bind()
    {
        GridView1.DataSource = TbEvlutionText.Select(new SqlWhere(), GlobalConfig.ConnectionString);
        GridView1.DataBind();
    }

    protected void btnDelete_Click(object sender, EventArgs e)
    {
        TbEvlutionText mode = new TbEvlutionText();
        //OQLWhere where2 = new OQLWhere(mode).AND(mode.UniqueIdentifier, "=", "123")
        //.AND(new OQLWhere(mode).AND(mode.Code, "=", "456").OR(mode.CreateDate, "<>", "789")
        //.AND(new OQLWhere(mode).AND(mode.UniqueIdentifier, ">=", "91011")));
        OQLWhere where = new OQLWhere(mode).IN(mode.UniqueIdentifier, " AND ", Text1.Value.Split(','));

        TbEvlutionText.Delete(where, GlobalConfig.ConnectionString);
        Bind();
    
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        TbEvlutionText model=new TbEvlutionText();
        OQLWhere where = new OQLWhere(model).AND(model.UniqueIdentifier, "=", e.CommandArgument.ToString());
        TbEvlutionText.Delete(where, GlobalConfig.ConnectionString);
        Bind();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
    }
}